home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / communic / pcmail / main / kp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  2.3 KB  |  90 lines

  1. /*++
  2. /* NAME
  3. /*    kp 5
  4. /* SUMMARY
  5. /*    definitions file for k protocol
  6. /* PACKAGE
  7. /*    uucp across the thenet
  8. /* SYNOPSIS
  9. /*    #include "kp.h"
  10. /* DESCRIPTION
  11. /*    The following definitions are made in the file kp.h:
  12. /* .nf
  13.  
  14.  /* Need stderr definition from stdio.h */
  15.  
  16. #include "stdio.h"
  17.  
  18.  /* Symbol Definitions */
  19.  
  20. #define    PACKSIZ     256            /* Packet size sent by this uucico */
  21. #define MAXPACKSIZ  1024        /* Maximum packet size I can receive */
  22. #define SOH         16            /* Start of header */
  23. #define CR          13            /* ASCII Carriage Return */
  24. #define    SP          32            /* ASCII Blank */
  25.  
  26. #define MAXTRY      10            /* Times to retry a packet */
  27.  
  28.  /* 5 secs timeout interval turns out to be too short, when THEnet is busy */
  29.  
  30. #define TIMEOUT     10            /* Seconds after which I should be
  31.                      * timed out */
  32.  
  33. #define TRUE         1            /* Boolean constants */
  34. #define FALSE        0
  35.  
  36. #define    NULLP (char*)0            /* NULL pointer */
  37. #define    FAIL        -1            /* Read/write return value in case of
  38.                      * error */
  39. #define    TIME        -2            /* Receive packet return status if
  40.                      * timed out */
  41.  
  42. #define    OUT          6            /* Nr. of data bits per char in
  43.                      * packet */
  44. #define    IN           8            /* Nr. of data bits per byte */
  45. #define    STEP         2            /* Difference between previous two */
  46. #define    MASK       077            /* Mask for number of data bits in
  47.                      * packet */
  48.  
  49.  /* Macro Definitions */
  50.  
  51. #define tosix(ch)  (((ch) & MASK) + SP)
  52. #define unsix(ch)  (((ch) - SP) & MASK)
  53.  
  54. #define tochar(ch)  ((ch) + SP)
  55. #define unchar(ch)  ((ch) - SP)
  56.  
  57.  /* intercept system calls in case of non-unix operating systems */
  58.  
  59. #ifndef    unix
  60.  
  61. #define    read        xread
  62. #define    write        xwrite
  63. #define    alarm(x)    /* nothing */
  64. #define    signal(x,y)    /* nothing */
  65. #define    DEBUG(x,y,z)    if (dflag >= x) printf(y,z)
  66.  
  67. extern int dflag;
  68.  
  69. #else
  70.  
  71. #define DEBUG(l,f,s) if (Debug >= l) fprintf(stderr,f,s)
  72.  
  73.  /* Declarations */
  74.  
  75. extern int Debug;            /* Debugging level */
  76.  
  77. #endif
  78. /* AUTHOR(S)
  79. /*    Wietse Venema
  80. /*    Eindhoven University of Technology
  81. /*    Department of Mathematics and Computer Science
  82. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  83. /* CREATION DATE
  84. /*    Mon Feb  3 22:14:23 MET 1986
  85. /* LAST MODIFICATION
  86. /*    90/01/22 13:01:55
  87. /* VERSION/RELEASE
  88. /*    2.1
  89. /*--*/
  90.